package com.yunwuliu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunwuliu.bean.TUser;
import com.yunwuliu.mapper.TUserMapper;
import com.yunwuliu.request.RegisterRequest;
import com.yunwuliu.service.RegisterService;
import com.yunwuliu.service.TUserService;
import com.yunwuliu.util.NumGenerateUtil;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @author 16375
 * @version 1.0
 * @description: TODO
 * @date 2025/8/12 13:25
 */
@Service
public class RegisterServiceImpl extends ServiceImpl<TUserMapper, TUser>
implements TUserService, RegisterService {

    @Resource
    TUserMapper tUserMapper;
    /**
     * @param request
     * @return
     */
    @Override
    public int register(RegisterRequest request) {
        TUser user = new TUser();
        NumGenerateUtil.copy(request,user);
        return tUserMapper.insert(user);
    }
}
